#ifndef _PYHIGHLIGHTER_H_
#define _PYHIGHLIGHTER_H_
#include <QSyntaxHighlighter>
class ModuleScope;

class PyHighlighter: public QSyntaxHighlighter
{
public:
    PyHighlighter(ModuleScope *scope, QTextDocument * parent);
    virtual void highlightBlock(const QString &text);
private:
    int format(const QString& type);
    QTextCharFormat* formatForState(int state);
    void parseString(const QString& quote, const QString& text, int state, bool multiline = false);
private:
    struct Rule
    {
        QRegExp pattern;
        QTextCharFormat format;
    };
    QVector<Rule> _keywords;
    ModuleScope *_scope;
    QTextCharFormat _stringFormat;
    QRegExp _stringRex;
};

#endif
